home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 034a / twview82.zip / STATISTC.INC < prev    next >
Text File  |  1991-02-04  |  1KB  |  42 lines

  1.  
  2. function CountDist( howfar : integer ):integer;
  3. var
  4.   c : integer;
  5.   s : sector;
  6. begin
  7.   c := 0;
  8.   for s := 1 to maxSector do
  9.     if distances[ s ].d <= howfar then
  10.       c := c + 1;
  11.   countDist := c;
  12. end; {CountDist}
  13.  
  14. procedure StellarDispersion;
  15. const
  16.   maxDispersion = 29;
  17. var
  18.   s : sector;
  19.   disperse : array [0..maxDIspersion] of integer;
  20.   temp,
  21.   lost     : integer;
  22. begin
  23.   write( 'Stellar dispersion from what sector? ');
  24.   readln( s );
  25.   FixDistances( s, distances );
  26.   for temp := 0 to maxDispersion do
  27.     disperse[ temp ] := 0;
  28.   lost := 0;
  29.   for s := 1 to maxSector do
  30.     if distances[s].d < maxint then
  31.       disperse[ distances[ s ].d ] := disperse[ distances[ s ].d ] + 1
  32.     else if space.sectors[s].number > 0 then   { visited, but not connected?}
  33.       lost := lost + 1;
  34.   for temp := 0 to maxDispersion do
  35.     begin
  36.       write( disperse[ temp ] : 5 );
  37.       if temp mod 10 = 9 then
  38.         writeln;
  39.     end;
  40.   writeln('There are ', lost, ' unreachable sectors.');
  41. end;
  42.